package br.com.abril.task;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import br.com.abril.booking.BookingService;
import br.com.abril.job.AbstractTask;
import br.com.abril.prevision.PrevisionService;

import com.force.abril.booking.download.BookingServiceActivator;
import com.force.abril.prevision.download.PrevisionServiceActivator;
import com.sforce.ws.ConnectionException;


public class PurgeContentTask extends AbstractTask  {
	
	private static final Logger logger = Logger.getLogger(PurgeContentTask.class);
	
	private BookingService bookingService;
	private PrevisionService previsonService;
	
	public PurgeContentTask() {
		bookingService = applicationContext.getBean(BookingService.class);
		previsonService = applicationContext.getBean(PrevisionService.class);
	}
	
	@Override
	public void execute() {
		bookingService.deleteAll();
		previsonService.deleteAll();
		logger.info("................ Purge completed");
	}

}
